/*************************************************************************
	> File Name: sysinfo.c
	> Author: Angel Criss
	> Mail: abbytsing@gmail.com 
	> Created Time: Tue 18 Mar 2014 09:29:45 PM CST
 ************************************************************************/

#include<stdio.h>
#include<sys/utsname.h>
#include<stdlib.h>
int main(int argc, char *argv[])
{
    struct utsname uts;
    if(uname(&uts)!=0)
        perror("failed");
    else
        printf("sysname:\t%s\n",uts.sysname);
        printf("hostname::\t%s\n",uts.nodename);
        printf("release:\t%s\n",uts.release);
        printf("version:\t%s\n",uts.version);
        printf("machine:\t%s\n",uts.machine);
#ifdef _GNU_SOURCE
        char domianname[];
        printf("domainname:\t%s\n",domainname);
#endif
        exit(0);
}
